import 'package:flutter/material.dart';

///
///  flutter_ticket
///  printer_ticket_data.dart
///
///  Created by kayoxu on 2021/6/3 at 6:37 下午
///  Copyright © 2021 kayoxu. All rights reserved.
///

class PrinterTicketData {
  ///联单id
  int id;

  ///公司
  String company;

  ///起点
  String addressStart;

  ///终点
  String addressEnd;

  ///车牌号码
  String carNum;

  ///驾驶员
  String driverName;

  ///开单时间
  String ticketTime;

  ///开单人
  String ticketUser;

  ///运单号
  String ticketId;

  ///今日趟次
  String ticketTimes;

  ///条形码
  String ticketBarCode;

  ///二维码
  String ticketQrCode;

  PrinterTicketData.init(
      this.id,
      this.company,
      this.addressStart,
      this.carNum,
      this.driverName,
      this.ticketTime,
      this.ticketUser,
      this.addressEnd,
      this.ticketId,
      this.ticketTimes,
      this.ticketBarCode,
      this.ticketQrCode);

  PrinterTicketData(
      {this.id,
      this.company,
      this.addressStart,
      this.addressEnd,
      this.carNum,
      this.driverName,
      this.ticketTime,
      this.ticketUser,
      this.ticketId,
      this.ticketTimes,
      this.ticketBarCode,
      this.ticketQrCode});

  factory PrinterTicketData.fromJson(Map<String, dynamic> json) =>
      _$PrinterTicketDataFromJson(json);

  Map<String, dynamic> toJson() => _$PrinterTicketDataToJson(this);
}

PrinterTicketData _$PrinterTicketDataFromJson(Map<String, dynamic> json) {
  return PrinterTicketData(
    id: json['id'] as int,
    company: json['company'] as String,
    addressStart: json['addressStart'] as String,
    addressEnd: json['addressEnd'] as String,
    carNum: json['carNum'] as String,
    driverName: json['driverName'] as String,
    ticketTime: json['ticketTime'] as String,
    ticketUser: json['ticketUser'] as String,
    ticketId: json['ticketId'] as String,
    ticketTimes: json['ticketTimes'] as String,
    ticketBarCode: json['ticketBarCode'] as String,
    ticketQrCode: json['ticketQrCode'] as String,
  );
}

Map<String, dynamic> _$PrinterTicketDataToJson(PrinterTicketData instance) =>
    <String, dynamic>{
      'id': instance.id,
      'company': instance.company,
      'addressStart': instance.addressStart,
      'addressEnd': instance.addressEnd,
      'carNum': instance.carNum,
      'driverName': instance.driverName,
      'ticketTime': instance.ticketTime,
      'ticketUser': instance.ticketUser,
      'ticketId': instance.ticketId,
      'ticketTimes': instance.ticketTimes,
      'ticketBarCode': instance.ticketBarCode,
      'ticketQrCode': instance.ticketQrCode,
    };
